local skel = fk.CreateSkill{
  name = "ksp__chenzhu",
  tags = {Skill.Lord},
}

Fk:loadTranslationTable{
  ["ksp__chenzhu"] = "臣主",
  [":ksp__chenzhu"] = "主公技，蜀势力角色于出牌阶段可以对你使用【桃】。当你回复体力至上限时，你可以改为令任意名蜀势力角色各摸一张牌。",
 
  ["#ksp__chenzhu"] = "臣主：你可以防止此次体力回复，改为令任意名蜀势力角色各摸一张牌",

  ["$ksp__chenzhu1"] = "九凤来盘，百国系颈，效周公持重，归来由许在隆中。",
  ["$ksp__chenzhu2"] = "朋僚望汉，未卒盛勋，敢当此一先，英雄功业如鼎烟。",
}

skel:addEffect(fk.PreHpRecover, {
  can_trigger = function(self, event, target, player, data)
      return player:hasSkill(skel.name) and target == player and (player.hp + data.num) >= player.maxHp
  end,
  on_cost = function (self, event, target, player, data)
    local room = player.room
    local ts = table.filter(room:getAlivePlayers(),function (t)
      return t.kingdom == "shu"
    end)
    if #ts == 0 then return end
    ts = room:askToChoosePlayers(player,{
      targets = ts,
      min_num = 1,
      max_num = 999,
      skill_name = skel.name,
      prompt = "#ksp__chenzhu",
    })
    event:setCostData(self,{tos = ts})
    return #ts > 0
  end,
  on_use = function (self, event, target, player, data)
    data:preventRecover()
    local tos = event:getCostData(self).tos
    player.room:sortByAction(tos)
    for _, t in ipairs(tos) do
      t:drawCards(1,skel.name)
    end
  end,
})

return skel